package com.tingyuge.thinking.spring.configuration.metadata;

import com.tingyuge.thinking.spring.ioc.overview.domain.User;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * spring xml 扩展示例
 * @author xiaodao
 * @version 1.0
 * @date 2021/8/22
 */
public class ExtansibleXmlAuthoringDemo {
    public static void main(String[] args) {
        //1.创建IOC 底层容器
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
        // 创建 xml 资源
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);

        reader.loadBeanDefinitions("META-INF/user-context.xml");
        User bean = beanFactory.getBean(User.class);
        System.out.println(bean);
    }
}
